package com.code.soulspringboot.code;

/**
 * 可以定义一个大点的枚举异常类，也可以根据不同类型定义不同的异常类
 * 一般来说定义一个统一的枚举异常类就够了，里面只维护code和msg即可
 * @author lyf
 * @date 2022-11-20 22:04
 */
public enum BizResponseCode implements CommonErrorCode {
    SUCCESS(000000, "成功"),
    SYS_ERROR(111111, "系统异常"),

    REPEAT_CODE(100001, "重复的点位code,code值是,%s"),
    MANY_LENGTH_CODE(100002, "点位code长度是%s,太长了"),

    ;

    private Integer code;
    private String msg;

    BizResponseCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }

    @Override
    public String toString() {
        return "BizResponseCode{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
